﻿<UserControl
    x:Class="Srk.BetaseriesApiApp.Views.Version"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <WrapPanel Grid.Row="0" Orientation="Horizontal">
            <Button Command="{Binding MethodsCommand}" 
                                HorizontalAlignment="Left" Margin="4" Content="Update"/>
            <Button Command="{Binding CopyTracCommand}" 
                                HorizontalAlignment="Left" Margin="4" Content="Copy for trac"/>
            <Button Command="{Binding SaveCsvCommand}" 
                                HorizontalAlignment="Left" Margin="4" Content="Save as CSV"/>
        </WrapPanel>

        <WrapPanel Grid.Row="1" Orientation="Horizontal">
            <CheckBox Content="Implemented" IsThreeState="True"
                                  IsChecked="{Binding FilterImplemented}" Margin="8,4,8,4" />
            <CheckBox Content="Up-to-date" IsThreeState="True"
                                  IsChecked="{Binding FilterUptodate}" Margin="8,4,8,4" />
        </WrapPanel>

        <ListView Grid.Row="2" Margin="4"
                              ItemsSource="{Binding MethodsCV}"
                              ItemContainerStyleSelector="{StaticResource VersionListViewItemStyleSelector}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Method" 
                                                DisplayMemberBinding="{Binding Name}" />
                    <GridViewColumn Header="Implemented?" 
                                                DisplayMemberBinding="{Binding IsImplemented}"
                                                CellTemplate="{StaticResource BoolGridViewColumnWithColors}" />
                    <GridViewColumn Header="Last" 
                                                DisplayMemberBinding="{Binding Last}" />
                    <GridViewColumn Header="Current" 
                                                DisplayMemberBinding="{Binding Current}" />
                    <GridViewColumn Header="Up-to-date" 
                                                DisplayMemberBinding="{Binding IsUpToDate}"
                                                CellTemplate="{StaticResource BoolGridViewColumnWithColors}"  />
                </GridView>
            </ListView.View>
        </ListView>

        <TextBlock Grid.Row="3" Text="{Binding StatusMessage}" Margin="4" />
    </Grid>
</UserControl>
